<template>
<div style="height:100%">
  <div class="buttonarea">
    <el-button type="warning" @click="handleCopy(ylweburl,$event)">复制本产品官网网址</el-button>
    <el-button type="warning" @click="handleCopy(weburl,$event)">复制优保官网网址</el-button>
    <el-button type="warning" @click="handleCopy(appurl,$event)">复制APP下载网址</el-button>
    <el-button type="warning" @click="handleCopy(crmurl,$event)">复制CRM网址</el-button>
    <el-button type="primary">生成我的H5海报专属申报渠道</el-button>
    <el-button type="primary">生成我的海报专属渠道二维码</el-button>
    <el-button type="primary">下载PDF宣传册</el-button>
    <el-button type="primary">申请实物物料</el-button>
 </div>
 


  <div style="text-align: center;">
    <img src="@/assets/images/youbao/baoxian.png" style="width: 700px;">
  </div>


  </div>
</template>

<script>
import { getmembers,getcustomers,unlockmember,stopmember } from '@/api/policy'
import clip from '@/utils/clipboard'


export default {
  name: 'sucaixq',
  components: { },
    computed: {
  },
  data() {
    return {
      page:1,
      weburl:'http://static.sodataint.com/yanjiuyuan/index.html',
      ylweburl:'http://static.sodataint.com/',
      crmurl:'http://crm.zhiyuewulian.com/',
      appurl:'http://www.insfair.cn/#/',
      total:0,
      input5:'',
      select:'0',
      radio:1,
      state:'0',
      searchtag:"0",
    tableData: [ ],


    }
      
  },
  components:{


  },
  mounted(){
this.getmembers();

  },
  methods:{
         handleCopy(text, event) {
          clip(text, event)           
          console.log('clicp')
       },
    gosearch()
    {
    this.page=1;
    this.total=0;
    this.searchtag=1;
    this.getmembers();



    },
      reset()
    {
    this.page=1;
    this.total=0;
    this.searchtag=0;
    this.getmembers();



    },
         getNowFormatDate(dt) {
        var date = new Date(dt);
        var seperator1 = "-";
        var year = date.getFullYear();
        var month = date.getMonth() + 1;
        var strDate = date.getDate();
        if (month >= 1 && month <= 9) {
            month = "0" + month;
        }
        if (strDate >= 0 && strDate <= 9) {
            strDate = "0" + strDate;
        }
        var currentdate = year + seperator1 + month + seperator1 + strDate;
        return currentdate;
    },
      getmembers(){

this.$loadingshow();
       getcustomers({ page:this.page,searchtag:this.searchtag,size:10,customertype:this.radio,key:this.select,keyword:this.input5,key2:this.state }).then(res => {
              this.$loadingclose();
       if (res.code == 200) {
              this.tableData=res.result.list;
              this.total=res.result.total;
              for(var i=0;i<this.tableData.length;i++)
              {
            this.tableData[i].index=i;
                   this.tableData[i].typedesc=this.tableData[i].type==1?'重点':'普通'


              }
           //   document.getElementsByClassName('el-table__body-wrapper')[0].style.height='auto';
        } 
        else{
          this.$toast(res.message)
        }
      });
    },
    addcustomer(){
      this.$router.push('addcustomer');
    },
    genjin(row){
      this.$router.push('genjin?id='+row.id+'&name='+row.companyname);
    },
    toadd(value){
    // this.$router.push('addpolicy');
    window.open('http://chudan.zhiyuewulian.com');
    },
    filterTag(){

    },
handleSizeChange(){

},
handleCurrentChange(){
     this.getmembers();
},
handleClick(id,index) {
        //this.$router.push('chakan');
        this.$loadingshow();
       unlockmember({id:id }).then(res => {
           this.$loadingclose();
        if (res.code == 200) {
          this.tableData[index].status=4;
          this.$toast('解锁成功')
        } 
        else{
          this.$toast(res.message)
        }
      });
      },
      handleClickread(row) {
        this.$router.push('/youbao/chakan?id='+row.id);
      },
      stopmember(id,index){

       this.$loadingshow();
       stopmember({id:id }).then(res => {
           this.$loadingclose();
        if (res.code == 200) {
          this.tableData[index].status=3;
          this.$toast('停止成功')
        } 
        else{
          this.$toast(res.message)
        }
      });


      }
  }
}
</script>

<style lang="scss" scoped>
.buttonarea{
  width:75%;
      margin: 20px auto;
      text-align: center;
display: flex;
    flex-wrap: wrap;
    justify-content:space-between;
  // height: 50px;
}
.btn{
  position: relative;
    /* left: 73%; */
    float: right;
    right: 9px;
    margin-top: 6px;
}
.block{
      text-align: center;
      margin-top:10px;
}

.documentation-container {
  // margin: 50px;
  .document-btn {
    float: left;
    margin-left: 50px;
    display: block;
    cursor: pointer;
    background: black;
    color: white;
    height: 60px;
    width: 200px;
    line-height: 60px;
    font-size: 20px;
    text-align: center;
  }
}
   .popstyle{
        width: 100%;
        height: 30%;
    }
    .userfile{
    width: 90px;
    height: 30px;
    background: cornflowerblue;
    font-size: 14px;
    color: #fff;
    line-height: 30px;
    border-radius: 10px;
    text-align: center;
    margin: 0 auto;
    margin-top: 20px;
}
/deep/  .el-input--suffix .el-input__inner{
  width:120px;
}
/deep/ .el-form-item{
  width: 30%;
}
</style>
<style>
  .el-button{
    margin: 10px;
    width: 224px;
  }
</style>
